import request from "@/utils/request";

// 查询商品信息列表
export function listLoot(query) {
  return request({
    url: "/ds/loot/list",
    method: "get",
    params: query,
  });
}

// 查询商品信息详细
export function getLoot(id) {
  return request({
    url: "/ds/loot/" + id,
    method: "get",
  });
}

// 新增商品信息
export function addLoot(data) {
  return request({
    url: "/ds/loot",
    method: "post",
    data: data,
  });
}

// 修改商品信息
export function updateLoot(data) {
  console.log("data:", data);
  return request({
    url: "/ds/loot",
    method: "put",
    data: data,
  });
}

// 删除商品信息
export function delLoot(id) {
  return request({
    url: "/ds/loot/" + id,
    method: "delete",
  });
}

// 导出商品信息
export function exportLoot(query) {
  return request({
    url: "/ds/loot/export",
    method: "get",
    params: query,
  });
}
/**
 * 抽奖列表
 * @param {*} query
 * @returns
 */
export const stageList = (query) => {
  return request({
    url: "/ds/stage/list",
    method: "get",
    params: query,
  });
};

/**
 * 停止
 * @param {*} query
 * @returns
 */
export const stopStage = (query) => {
  return request({
    url: "/ds/stage/endTheLoot",
    method: "get",
    params: query,
  });
};
/**
 * 新增抽奖
 * @param {*} query
 * @returns
 */
export const stageAdd = (query) => {
  return request({
    url: "/ds/stage/add",
    method: "get",
    params: query,
  });
};
/**
 *  查询夺宝记录列表
 */
export const lootRecordList = (query) => {
  return request({
    url: "/ds/lootRecord/list",
    method: "get",
    params: query,
  });
};

/**
 * 抽奖发货
 * @param {*} query
 * @returns
 */
export const lootListDelivery = (query) => {
  return request({
    url: "/ds/stage/edit",
    method: "get",
    params: query,
  });
};

/**
 * 抽奖订单导出
 * @param {*} query
 * @returns
 */
 export const stageExport = (query) => {
  return request({
    url: "/ds/stage/export",
    method: "get",
    params: query,
  });
};
